<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%> 
<html>
<head>  
  <script type="text/javascript">
  function doSearch() {	 
	  grid.load({
			channel_no: $('#channel_no').val(),
			trf_mchnt_cd: $('#trf_mchnt_cd').val(),
			term_nm: $('#term_nm').val(),
			ins_cd: $('#ins_cd').val(),
			ins_cn_nm: $('#ins_cn_nm').val(),
			sign_st: $('#sign_st').val()
		});
  }
  
  function addHostLarge(url){	  
	  commonDetail(url+$('#channel_no').val(),"save","hostlargeTableId");
  }
  function modifyHostLarge(url){	  
	  commonDetail(url+$('#channel_no').val()+"&host_large_uuid=","update","hostlargeTableId");
  }
  function deleteHostLarge(url){	  
	  commonDel(url+$('#channel_no').val()+"&host_large_uuids=","delete","hostlargeTableId");
  }
  var grid;
  $(document).ready(function() {	
	  $.ajax({
		  type: 'POST',
		  url: "../channelinf/getChannelByTp.do?chn_tp=0",
		  success: function(data) {	
			  var msg = [];			  
			  for(var i=0;i<data.length;i++){
				  if(i==0){
					  msg.push({ "id": data[i].ID, "text": data[i].TEXT,"selected":true });  
				  }else{					  
				  	  msg.push({ "id": data[i].ID, "text": data[i].TEXT });				  
				  }
			  }			 
			  $("#channel_no").combobox({
				   	data:msg,
				    valueField:'id',
				    textField:'text',
				    panelHeight:'auto',
				    editable:false ,
				    onLoadSuccess:function(param){
				    	var channel_no="";
				    	if(param.length>0){
				    		channel_no=param[0].id;			    		
				    	}
				    	grid = $("#hostlargeTableId").jpgrid({
							url: "getHostLargeListJson.do",
							queryParams: {
								channel_no: channel_no
							}, 
							columns: [
								{title: "渠道方商户号", field: "TRF_MCHNT_CD"},
								{title: "渠道方终端号", field: "TRF_TERM_ID"},
								{title: "商户名称", field: "TERM_NM"},
								{title: "所属机构", field: "INSNAME"},
								{title: "业务名称", field: "SERNAME"},
								{title: "业务参数名称", field: "PURNAME"},
								{title: "所属地区", field: "AREANAME"},
								{title: "收单行号", field: "ACQ_INS_CD"},
								{title: "主秘钥索引", field: "MASTER_KEY_IDX"},
								{title: "主秘钥", field: "MASTER_KEY"},
								{title: "所属通道", field: "CHANNEL"},
								{title: "借记卡-最小手续费(元)", field: "DEBIT_MINFEE"},
								{title: "借记卡-扣率(‱)", field: "DEBIT_RATE"},
								{title: "借记卡-最大手续费(元)", field: "DEBIT_MAXFEE"},
								{title: "贷记卡-最小手续费(元)", field: "CREDIT_MINFEE"},
								{title: "贷记卡-扣率(‱)", field: "CREDIT_RATE"},
								{title: "贷记卡-最大手续费(元)", field: "CREDIT_MAXFEE"},
								{title: "签到标志", field: "SIGN_ST"}								
							]
						});	
				    }
				}); 			  
	      }
	  });	 
  });
  </script>
</head>
<body class="easyui-layout list_body"  >
	<form id="hostlargeForm" name="hostlargeForm">
		<div class="list_body_north" data-options="region:'north'"  border="false" >
			<!-- 查询表单 -->
			<div  class="datagrid-toolbar" border="false"  >
				<div style="padding:3px">
					<span>所属通道:</span>
					<input class="easyui-combobox" id="channel_no" name="channel_no" >  
					<span>渠道方商户号:</span>
					<input id="trf_mchnt_cd" type="text" name="trf_mchnt_cd"  class="easyui-textbox"  >	
					<span>商户名称:</span>
					<input id="term_nm" type="text" name="term_nm"  class="easyui-textbox"  >	
					<span>机构号:</span>
					<input id="ins_cd" type="text" name="ins_cd"  class="easyui-textbox"  >	
				</div>
				<div style="padding:3px">
					<span>机构名称:</span>
					<input id="ins_cn_nm" type="text" name="ins_cn_nm"  class="easyui-textbox"  >
					<span>签到标志:</span>
					<code:codeSelect id="sign_st" name="sign_st" code_type="sign_st" showSelect="true" ></code:codeSelect>					
				 	<a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch() ">查询</a>
				 	<a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm() ">重置</a>
				</div>				
			</div>
			<!-- 自定义标签工具栏 -->
			<jiepos:buttonOperateTag menuCode="${menuCode}"></jiepos:buttonOperateTag>	
		</div>
		<div data-options="region:'center'" border="false"  class="list_body_center">		
			<!-- 表格 -->
			<table id="hostlargeTableId" fit="true"></table>
		</div>
	</form>
</body>
 </html>
